<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="se"
	uri="http://www.springframework.org/security/tags"%>
<link type="text/css" rel="stylesheet"
	href="resources/css/patient/articleHeader.css">
<link type="text/css" rel="stylesheet"
	href="resources/css/patient/notice.css">
<div>
	<div class="nav_information">
		<img src="resources/images/gr_navi_home.png">&nbsp;&nbsp;>&nbsp;&nbsp;병원소식
	</div>
	<div class="nav_detail_name">병원소식</div>
	<div class="nav_information_detail">
		<div class="nav_information_detail_bgimg">
			<p>메디컬탑병원 공지 및 소식 입니다.</p>
			<p>병원을 이용하시는 고객을 위하여 다양한 소식과 서비스를 알려드립니다.</p>
		</div>
	</div>
</div>

<div class="noticeMainDiv">
	<form action="noticeWrite.do" method="get">
		<div>
			<table id="n_table">
				<tr id="tr_title">
					<td class="noticeNum">번호</td>
					<td class="noticeTitle">제목</td>
					<!-- <td class="width_150px">작성자</td> -->
					<td class="noticeWritedate">등록일</td>
				</tr>
				<c:forEach items="${list }" var="n">
					<tr class="tr_list">
						<td class="noticeNumList">${n.notice_id }</td>
						<td class="noticeTitleList"><a
							href="noticeDetail.do?notice_id=${n.notice_id }">${n.title }</a></td>
						<td class="noticeWritedateList">${n.write_date }</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<div class="page_box">
			<ul>
				<c:if test="${startPage>1}">
					<input type="button" class="pagingButton" value="이전"
						onclick="location.href='notice.do?pageNumber=${startPage-1}'">
				</c:if>
				<c:forEach var="i" begin="${startPage}" end="${endPage}">
					<c:choose>
						<c:when test="${pageNumber == i }">
							<c:if test="${pageNumber == i}">
								<input type="button" class="enablePagingButton" value="${i}">
							</c:if>
						</c:when>
						<c:otherwise>
							<c:if test="${pageNumber != i}">
								<input type="button" class="pagingButton" value="${i}"
									onclick="location.href='notice.do?pageNumber=${i}'">
							</c:if>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:if test="${endPage < totalPageCount}">
					<span> <input type="button" class="pagingButton" value="다음"
						onclick="location.href='notice.do?pageNumber=${endPage+1}'">
					</span>
				</c:if>
			</ul>
		</div>
		<se:authorize ifAnyGranted="ROLE_ADMIN">
			<div class="noticeWriteBtn">
				<input type="button" id="noticeBtn" class="normalBtn" value="글쓰기"
					onclick="location.href='noticeWrite.do'">
			</div>
		</se:authorize>
	</form>
</div>
